let alphanumeric = {
mounted(el) {
    el.handler = function (event) {
        event.target.value = event.target.value.replace(/[^a-zA-Z0-9]/g, ''); // 仅保留字母和数字
        event.target.dispatchEvent(new Event("input")); //调用input事件使vue v-model绑定更新,下面相同
    }
    el.addEventListener('keyup', el.handler);
  }
}

export default alphanumeric